Initial StateRegister implementation.#482
Conversation
A `StateRegister` is just like a `Register`, except its bitwidth is defined by an `IntEnum`, and `render_trace` displays the `IntEnum`'s name instead of its `int` value. This also changes `enum_name` so it converts unknown `int` values to string with `hex`, instead of throwing a `ValueError`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #482 +/- ##
=============================================
+ Coverage 91.9% 91.9% +0.1%
=============================================
Files 30 30
Lines 7443 7460 +17
=============================================
+ Hits 6837 6854 +17
Misses 606 606 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@timsherwood Thinking about this more, maybe this feature should be added to |
When a `Register` is constructed with a `State`, the `Register`'s bitwidth is determined by the `IntEnum`'s maximum value, and `render_trace` displays enumeration names instead of hex values.
Okay I pushed another commit that adds a |
A
StateRegisteris just like aRegister, except its bitwidth is defined by anIntEnum, andrender_tracedisplays theIntEnum's name instead of itsintvalue.This also changes
enum_nameso it converts unknownintvalues to string withhex, instead of throwing aValueError.